<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const str = '       lish  en g hao   '
    console.log(str)
    console.log(str.length)
    //trim方法：去除左右空格，中间没效果（因为英文中间本来就需要空格隔开）
    console.log(str.trim())
    console.log(str.trim().length)

    console.log(str.trim() === '')
  </script>
</body>

</html>